package mall.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class UtilityClass {
	public static final String VIEW_MALL_INDEX = "index";
	public static final String VIEW_MALL_LISTSHOP = "listshop";
	public static final String VIEW_MALL_REGISTER = "register";
	public static final String VIEW_MALL_CREATESHOP = "createshop";
	public static final String VIEW_MALL_LOGIN = "login";
	public static final String VIEW_MALL_STATIC_ABOUT = "about-mall";
	public static final String VIEW_MALL_STATIC_BLOG = "blog-mall";
	public static final String VIEW_MALL_STATIC_CONTACT = "contact-mall";
	public static final String VIEW_MALL_STATIC_SALE = "sale-mall";

	public static final String VIEW_SHOP_INDEX = "index-shop";
	public static final String VIEW_SHOP_PREVIEW = "preview";
	public static final String VIEW_SHOP_HOME = "home-shop";
	public static final String VIEW_SHOP_CHECKOUT = "checkout";
	public static final String VIEW_SHOP_PAYMENT = "payment";
	public static final String VIEW_SHOP_ADMIN = "index-admin-shop";
	public static final String VIEW_SHOP_CATEGORY_ADMIN = "category-admin-shop";
	public static final String VIEW_SHOP_PRODUCT_ADMIN = "product-admin-shop";
	public static final String VIEW_SHOP_ORDER_ADMIN = "order-admin-shop";
	public static final String VIEW_SHOP_ORDERDETAIl_ADMIN = "orderdetail-admin-shop";
	public static final String VIEW_SHOP_ADD_PRODUCT_ADMIN = "addproduct-admin-shop";
	public static final String VIEW_SHOP_UPDATE_PRODUCT_ADMIN = "updateproduct-admin-shop";
	public static final String VIEW_SHOP_UPDATE_CATEGORY_ADMIN = "updatecategory-admin-shop";
	
	public static final String VIEW_SHOP_STATIC_ABOUT = "about-shop";
	public static final String VIEW_SHOP_STATIC_CONTACT = "contact-shop";
	public static final String VIEW_SHOP_STATIC_DELIVERY = "delivery-shop";
	public static final String VIEW_SHOP_STATIC_NEWS = "news-shop";
	
	public static final int MEMBER_POSITION_ADMIN = 1;
	public static final int MEMBER_POSITION_SHOP_OWNER = 2;
	public static final int MEMBER_POSITION_GUEST = 3;

	public static final int MEMBER_TYPE_LEVEL_1 = 1;
	public static final int MEMBER_TYPE_LEVEL_2 = 2;
	public static final int MEMBER_TYPE_LEVEL_3 = 3;
	
	public static final String CURRENT_PRODUCT_ID="current-product-id";
	
	public static final int PAYMENT_ERROR_CODE_SUCCESS=0;
	public static final int PAYMENT_ERROR_CODE_FAIL=1;
	
	public static final int PAYMENT_METHOD_CASH=0;
	public static final int PAYMENT_METHOD_ONLINEPAYMENT_NOT_FINISHED=1;
	public static final int PAYMENT_METHOD_ONLINEPAYMENT_FINISHED=2;
	
	// Significant Error
	public static final String NOT_LOGGED_IN="NOT_LOGGED_IN";
	public static final String LOGGED_IN="LOGGED_IN";

	public static String generateUniqueFileName() {
		String DATE_FORMAT = "yyyyMMdd_HHmmss-SSS";
		SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
		Random nahcis = new Random();
		String unique = sdf.format(new Date()) + "_" + nahcis.nextInt(9999)
				+ "_";
		return unique;
	}
}
